Skip to content

Conversation

@Michael137
Copy link
Member

@Michael137 Michael137 commented Oct 16, 2024

Follow up to #111902.

Makes sure all the no_unique_address tests are in the same place and we don't rely on the host target triple (which means we don't need to account for [[msvc::no_unique_address]] on Windows).

Now that we don't compile with the host compiler, this patch also adds -c to the compilation command since we don't actually need the linked binary in the test anyway (and on Darwin linking through Clang requires the xcrun prefix to set up the SDK paths, etc.). We already do this in no_unique_address-with-bitfields.cpp anyway.

Follow up to llvm#111902.

Makes sure all the `no_unique_address` tests are in the same
place and we don't rely on the host compiler.

Now that we don't compile with the host compiler, this patch
also adds `-c` to the compilation command since we don't actually
need the linked binary in the test anyway (and on Darwin linking
through Clang requires the `xcrun` prefix to set up the SDK paths,
etc.). We already do this in `no_unique_address-with-bitfields.cpp`
anyway.
@Michael137 Michael137 requested review from labath and slydiman October 16, 2024 11:31
@llvmbot llvmbot added the lldb label Oct 16, 2024
@Michael137 Michael137 changed the title [lldb][test] Move no_unique_address to DWARF/x86 [lldb][test] Move no_unique_address tests to DWARF/x86 Oct 16, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 16, 2024

@llvm/pr-subscribers-lldb

Author: Michael Buch (Michael137)

Changes

Follow up to #111902.

Makes sure all the no_unique_address tests are in the same place and we don't rely on the host compiler.

Now that we don't compile with the host compiler, this patch also adds -c to the compilation command since we don't actually need the linked binary in the test anyway (and on Darwin linking through Clang requires the xcrun prefix to set up the SDK paths, etc.). We already do this in no_unique_address-with-bitfields.cpp anyway.


Full diff: https://github.com/llvm/llvm-project/pull/112523.diff

2 Files Affected:

  • (renamed) lldb/test/Shell/SymbolFile/DWARF/x86/no_unique_address-alignment.cpp (+1-1)
  • (renamed) lldb/test/Shell/SymbolFile/DWARF/x86/no_unique_address-base-alignment.cpp (+1-1)
diff --git a/lldb/test/Shell/SymbolFile/DWARF/no_unique_address-alignment.cpp b/lldb/test/Shell/SymbolFile/DWARF/x86/no_unique_address-alignment.cpp
similarity index 89%
rename from lldb/test/Shell/SymbolFile/DWARF/no_unique_address-alignment.cpp
rename to lldb/test/Shell/SymbolFile/DWARF/x86/no_unique_address-alignment.cpp
index 1488199a3ad2d3..e198bf0cafeaac 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/no_unique_address-alignment.cpp
+++ b/lldb/test/Shell/SymbolFile/DWARF/x86/no_unique_address-alignment.cpp
@@ -1,6 +1,6 @@
 // XFAIL: *
 
-// RUN: %clangxx_host -gdwarf -o %t %s
+// RUN: %clang --target=x86_64-apple-macosx -c -gdwarf -o %t %s
 // RUN: %lldb %t \
 // RUN:   -o "expr alignof(OverlappingFields)" \
 // RUN:   -o "expr sizeof(OverlappingFields)" \
diff --git a/lldb/test/Shell/SymbolFile/DWARF/no_unique_address-base-alignment.cpp b/lldb/test/Shell/SymbolFile/DWARF/x86/no_unique_address-base-alignment.cpp
similarity index 91%
rename from lldb/test/Shell/SymbolFile/DWARF/no_unique_address-base-alignment.cpp
rename to lldb/test/Shell/SymbolFile/DWARF/x86/no_unique_address-base-alignment.cpp
index 15d8de0e3ee988..c4bcfc473277f6 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/no_unique_address-base-alignment.cpp
+++ b/lldb/test/Shell/SymbolFile/DWARF/x86/no_unique_address-base-alignment.cpp
@@ -1,6 +1,6 @@
 // XFAIL: *
 
-// RUN: %clangxx_host -gdwarf -o %t %s
+// RUN: %clang --target=x86_64-apple-macosx -c -gdwarf -o %t %s
 // RUN: %lldb %t \
 // RUN:   -o "expr alignof(OverlappingDerived)" \
 // RUN:   -o "expr sizeof(OverlappingDerived)" \

@Michael137 Michael137 changed the title [lldb][test] Move no_unique_address tests to DWARF/x86 [lldb][test] Explicitly add target triple to no_unique_address Shell tests Oct 16, 2024
Copy link
Collaborator

@labath labath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll just note that %clang_host is not the host compiler (in the way that I understand the term). It's the clang we've just built, configured to build for the (current) host.

@Michael137
Copy link
Member Author

Michael137 commented Oct 16, 2024

I'll just note that %clang_host is not the host compiler (in the way that I understand the term). It's the clang we've just built, configured to build for the (current) host.

Ooh I see, I didn't realize that. When would we not want to use clangxx_host then? I guess when we want to create object files configured for a different target?

EDIT: Ah nevermind, part of the clangxx_host flags is the --target. Which answers my question

@Michael137 Michael137 merged commit 4e6fa78 into llvm:main Oct 16, 2024
9 checks passed
@Michael137 Michael137 deleted the lldb/move-nua-tests branch October 16, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants